const CinemaReducer = (preState = { cinemaList: [] }, action = {}) => {
  const state = { ...preState };
  const { type, payload } = action;
  switch (type) {
    case 'change-cinemaList':
      state.cinemaList = [...payload];
      return state;
    case 'clear-cinemaList':
      state.cinemaList = [];
      return state;
    default:
      return preState;
  }
};

export default CinemaReducer;
